package org.example.spring_trans.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.spring_trans.service.LogService;
import org.example.spring_trans.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
@Slf4j
@RequestMapping("/proga")
@RestController
public class PropagationController {
    @Autowired
    private UserService userService;
    @Autowired
    private LogService logService;
    @Transactional
    @RequestMapping("/p1")
    public String r8(String name,String password)throws IOException {

      userService.registryUser(name,password);
      logService.insertLog(name,"注册");
        return "注册成功";

    }
}
